package com.zjj.provider.service;

import com.zjj.DemoService;
import org.apache.dubbo.config.annotation.Service;

import java.util.concurrent.CompletableFuture;

@Service(version = "default")
public class DefaultDemoService implements DemoService {

    @Override
    public CompletableFuture<String> sayHelloAsync(String name) {
        System.out.println("执行了异步服务,参数 : " + name);

        return CompletableFuture.supplyAsync(() -> {

            return "异步执行完了";  // 正常访问
        });
    }

}
